<?php
/** \ExampleCorp\Learning\Block\Widget\Test $block */
$bannerImg = $this->getViewFileUrl('Lyh_Banner::images/banners/banner.jpg');
?>
<style>
  #banner-img{
    width:100%;
    height:300px;
}
</style>
<div class="banner-container">
  <h3>这个模板来自于主题目录.</h3>
  <img id='banner-img' src="<?=$bannerImg?>">

  <div>
    <button id="btn">点击事件</button>
  </div>
</div>

<script>
  require([ 
    'jquery',
    // 'banner',
    'js/banner/banner' // 引入banner.js
  ], function($, banner) {
    $('#btn').on('click', function () {
      alert('按钮点击事件被触发了');
    })
  })
</script>